#include<bits/stdc++.h>
using namespace std;
int n,a[200005],sum;
int main(){
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	sort(a,a+n);
	for(int i=0;i<n;i++)
		if(a[i]==a[i-1])sum++;
	cout<<sum-1;
	return 0;
} 
